package com.centronix.domain;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the stock database table.
 * 
 */
@Entity
public class Stock implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int stockId;

	private int units;

	//bi-directional many-to-one association to ProductRelease
	@OneToMany(mappedBy="stock")
	private List<ProductRelease> productReleases;

	//bi-directional many-to-one association to Purchase
    @ManyToOne
	@JoinColumn(name="PurchaseId")
	private Purchase purchase;

    public Stock() {
    }

	public int getStockId() {
		return this.stockId;
	}

	public void setStockId(int stockId) {
		this.stockId = stockId;
	}

	public int getUnits() {
		return this.units;
	}

	public void setUnits(int units) {
		this.units = units;
	}

	public List<ProductRelease> getProductReleases() {
		return this.productReleases;
	}

	public void setProductReleases(List<ProductRelease> productReleases) {
		this.productReleases = productReleases;
	}
	
	public Purchase getPurchase() {
		return this.purchase;
	}

	public void setPurchase(Purchase purchase) {
		this.purchase = purchase;
	}
	
}